"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/2/26 10:39
@Description :  不同函数的定义和使用

"""
class Aoo:
    class_attribute = 'this is a class attribute'

    def __init__(self):
        self.info = 'this is a instance info'

    #  修改实例属性 info
    def update_info(self, info):
        self.info = info

    def get_info(self):
        return self.info

    #  类函数 修改类的成员变量
    @classmethod
    def update_class_attribute(cls, info):
        cls.class_attribute = info

    @classmethod
    def get_class_attribute(cls):
        return cls.class_attribute

    #  静态函数
    @staticmethod
    def sum_static_method(num1: int, num2: int):
        return num1 + num2


aoo = Aoo()
print(aoo.get_info())
aoo.update_info('this is a new instance info')
print(aoo.get_info())

Aoo.update_class_attribute('this is a new class attribute')
print(Aoo.get_class_attribute())


result = Aoo.sum_static_method(1,2)
print(result)
